import type { GoodsResult, skuSpecResult } from '@/types/goods'
import { http } from '@/utils/http'

/**
 * 获取商品详情
 * @param id
 * @returns
 */
export const getGoodsByIdAPI = (id: string) => {
  return http<GoodsResult>({
    method: 'GET',
    url: `/goods`,
    data: { id },
  })
}

/**
 * 获取商品的规格列表
 */
export const getGoodsSpecsAPI = (id: string) => {
  return http<skuSpecResult>({
    method: 'GET',
    url: `/goods/specs`,
    data: { id },
  })
}
